package com.lemote.entity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * 流程任务
 * @author wuhui
 * @time 2011-7-16 下午10:50:29
 * @Version:0.0.1
 * @since smt
 */
@Entity
@Table(name="smt_flowTask")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class FlowTask extends IdEntity {

	private Flow flow;
	
	private Role role;
	
	private String taskEname;
	
	private String taskName;
	
	@ManyToOne
	@JoinColumn(name="flowid")
	public Flow getFlow() {
		return flow;
	}

	@ManyToOne
	@JoinColumn(name="roleid")
	public Role getRole() {
		return role;
	}

	public String getTaskEname() {
		return taskEname;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setFlow(Flow flow) {
		this.flow = flow;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public void setTaskEname(String taskEname) {
		this.taskEname = taskEname;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof FlowTask) {
			FlowTask task = (FlowTask)obj;
			return this.id == task.getId();
		}
		return false;
	}


	
	
}
